<!--
 * @description  : 证件-实地核查信息录入-确认信息
 * @descriptionDetail: 证件-实地核查信息录入-确认信息
 * @copyright    : 浙江烟草
 * @author       : dw
 * @create       : 2022-07-09 18:43:02
-->
<template>
  <view class="page">
    <view class="content">
      <view class="tmp-head">
        <u-image
          src="/static/certificate/ed.png"
          width="30rpx"
          height="40rpx"
        ></u-image>
        <text style="margin-left: 20rpx;">
          实地核查确认信息
        </text>
      </view>
      <u-form :label-style="labelStyle" :model="confirmInfo" :error-type="errorType" :rules="rules" ref="uForm">
        <u-form-item label="经营者头像" label-position="left" label-width="auto">
          <m-upload
            slot="right"
            :deletable="!isDisable"
            :disabled="isDisable"
            :maxCount="1"
            width="150rpx"
            height="150rpx"
            :file-list="managerPhoto"
            :multiple="false"
            index="managerPhoto"
            :uploadParam="{bizId:docIns.bizUuid,fiGroupCode:$FILE_GROUP_TYPE.l_lic_apply_img,fiLogicPath:$FILE_GROUP_TYPE.l_lic_apply_img}"
            @on-list-change="changeUpload"
          >
          </m-upload>
        </u-form-item>
        <u-form-item
          label="经营地址"
          :label-position="labelPosition"
          :required="isRequired"
          prop="businessAddrStreet"
          class="addr-info"
          ref="busAddrRefs"
        >
          <view class="apply-info-title apple-special-title">
            <view class="apply-span apple-special-con" style="line-height:28rpx">
              申
            </view>
            <view style="line-height:44rpx;">
              {{ fieldData.businessAddrStreet2 }}
            </view>
          </view>
          <view style="display: flex; flex-direction: column;width: 100%;">
            <u-input
              :border="border"
              type="select"
              :disabled="true"
              :select-open="pickerShow"
              placeholder="请选择所在地区(省市县)"
              v-model="confirmInfo.region"
              @click="pickerShow = !isDisable"
            ></u-input>
            <u-select mode="mutil-column-auto" label-name="text" :disabled="isDisable" :default-value="areaArray" :list="list" v-model="pickerShow" @confirm="regionConfirm">
            </u-select>
            <u-line :color="$theme.u_border_color" style="margin: 10rpx 0;"></u-line>
            <u-row gutter="16">
              <u-col span="12">
                <u-input
                  :disabled="isDisable"
                  :border="true"
                  placeholder="请输入完整地址"
                  v-model="confirmInfo.businessAddrStreet"
                >
                </u-input>
              </u-col>
            </u-row>
          </view>
        </u-form-item>
        <u-form-item prop="gisXY">
          <view class="loc-box" style="width:100%">
            <view class="loc-inline" style="font-size:28rpx">
              <span style="color:#fa3534">*</span>经营场所地址坐标(X、Y)
              <text style="font-size: 12px; color:#5f5d5d;">
                (定位自动获取经营地址等信息)
              </text>
            </view>
            <view class="inline-box">
              <u-input placeholder="请定位零售户位置" :needValid="true" :disabled="true" v-model="confirmInfo.gisXY"></u-input>
              <u-icon name="map-fill" :color="$theme.u_type_primary" size="56" @click="setLocation"></u-icon>
            </view>
          </view>
        </u-form-item>
        <u-form-item :label-width="labelWidth" label="中小学校周围" :required="isRequired" prop="isNearSchool">
          <u-switch
            :disabled="isDisable"
            slot="right"
            v-model="confirmInfo.isNearSchool"
            @change="switchChange($event,'isNearSchool','nearSchoolInstruction')"
          ></u-switch>
        </u-form-item>
        <u-form-item label="中小学校周围说明" :label-position="labelPosition" v-if="confirmInfo.isNearSchool">
          <u-input placeholder="请填写" :disabled="isDisable" v-model="confirmInfo.nearSchoolInstruction" />
        </u-form-item>
        <u-form-item label-width="190" label="幼儿园周围" :required="isRequired" prop="isNearGarten">
          <u-switch
            :disabled="isDisable"
            slot="right"
            v-model="confirmInfo.isNearGarten"
            @change="switchChange($event,'isNearGarten','nearGartenInstruction')"
          ></u-switch>
        </u-form-item>
        <u-form-item label="幼儿园周围说明" :label-position="labelPosition" v-if="confirmInfo.isNearGarten">
          <u-input placeholder="请填写" :disabled="isDisable" v-model="confirmInfo.nearGartenInstruction" />
        </u-form-item>
        <u-form-item
          label="所属街道（乡镇）"
          :required="isRequired"
          prop="town"
          :label-width="labelWidth"
          label-position="top"
          right-icon="arrow-right"
          ref="townChangeRef"
        >
          <u-select
            :list="streetData"
            :disabled="isDisable"
            mode="single-column"
            :default-value="[townDefaultVal]"
            v-model="townShow"
            @confirm="selectConfirm('townCode','town',$event)"
          ></u-select>
					<!-- 所属街道选择 auto-input 样式有问题 2023-10-27 fsx start -->
          <u-input
            :disabled="true"
            placeholder="请选择所属街道（乡镇）"
            v-model="confirmInfo.town"
            @click="townShow= !isDisable"
						:custom-style="pointerStyle"
          />
					<!-- 所属街道选择 auto-input 样式有问题 2023-10-27 fsx end -->
         <!-- <auto-input absIndex="1" :disabled="isDisable" :searchData="getTownInfoList" absClass="townClass" placeholder="请输入所属街道（乡镇）" v-model="confirmInfo.town" @choiceAutoItem="choiceAutoItem">
          </auto-input>
          <u-icon slot="right" name="arrow-down-fill" size="26" :color="$theme.u_type_info_disabled" @click="townShow = !isDisable"></u-icon> -->
        </u-form-item>
        <u-form-item
          label="社区（行政村）"
          :required="isRequired"
          prop="village"
          :label-width="labelWidth"
          label-position="top"
          right-icon="arrow-right"
          ref="villageChangeRef"
        >
          <u-select
            :list="villagesData"
            mode="single-column"
            :default-value="[villageDefaultVal]"
            v-model="villageShow"
            @confirm="selectConfirm('villageCode','village',$event)"
          ></u-select>
          <u-input
            :disabled="true"
            placeholder="请选择社区（行政村）"
            v-model="confirmInfo.village"
            @click="villageShow = !isDisable"
          />
          
          <!-- <u-icon slot="right" name="arrow-down-fill" size="26" :color="$theme.u_type_info_disabled" @click="villageShow = !isDisable"></u-icon> -->
        </u-form-item>
        <view class="u-border-bottom apply-box">
          <view class="apply-info-title apple-special-title">
            <view class="apply-span apple-special-con">
              申
            </view>
            <view style="line-height:44rpx;">
              {{ fieldData.groundOwnershipType2 }}
            </view>
          </view>
          <u-form-item
            label="场地权属"
            :label-width="labelWidth"
            :required="isRequired"
            label-position="top"
            prop="groundOwnershipName"
            :border-bottom="isShowBottom"
          >
            <dic-input
              :keyWord="$u.dic.DIC_KEYS.OWNERSHIP"
              :dicCode="confirmInfo.groundOwnershipType"
              :border="border"
              type="select"
              :select-open="dicSelectOpen('ower',$u.dic.DIC_KEYS.OWNERSHIP)"
              placeholder="请选择"
              v-model="confirmInfo.groundOwnershipName"
              @changeInputModelData="(name)=>{$set(confirmInfo, 'groundOwnershipName', name)}"
              @click="showDic($u.dic.DIC_KEYS.OWNERSHIP,confirmInfo.groundOwnershipType,'ower')"
            />
          </u-form-item>
        </view>
        <u-form-item
          v-if="confirmInfo.groundOwnershipType=='02'||confirmInfo.groundOwnershipType=='03'"
          label="是否长期"
          label-width="auto"
          label-position="left"
          :border-bottom="false"
        >
          <u-switch
            slot="right"
            :disabled="isDisable"
            v-model="confirmInfo.isLongTenancy"
            @change="switchChange($event,'isLongTenancy')"
          ></u-switch>
        </u-form-item>
        <u-form-item
          :required="isRequired"
          v-if="(confirmInfo.groundOwnershipType=='02'||confirmInfo.groundOwnershipType=='03') && (confirmInfo.isLongTenancy != true && confirmInfo.isLongTenancy != 'true')"
          label="租赁（无偿使用）期限时间区间"
          :label-position="labelPosition"
          prop="tenancyBeginDate"
          ref="startChangeRef"
        >
          <view style="display: flex;flex-direction: row;align-items: center;width: 100%;">
            <u-input
              style="flex: 1;"
              placeholder="请选择日期"
              :disabled="isDisabled"
							:custom-style="pointerStyle"
              v-model="confirmInfo.tenancyBeginDate"
              @click="clicDatekHandle('isShowCyBeginStart')"
            />
            <view style="margin-left: 10rpx;margin-right: 10rpx;flex-shrink: 0;">
              至
            </view>
            <u-input
              style="flex: 1;"
              placeholder="请选择日期"
              :disabled="isDisabled"
							:custom-style="pointerStyle"
              v-model="confirmInfo.tenancyEndDate"
              @click="clicDatekHandle('isShowCyBeginEnd')"
            />
          </view>
        </u-form-item>
        <view class="u-border-bottom apply-box">
          <view class="apply-info-title apple-special-title">
            <text class="apply-span apple-special-con">
              申
            </text>{{ fieldData.specialGroupTypeOther2 }}
          </view>
          <u-form-item label="群体类型" :label-width="labelWidth" label-position="top" :border-bottom="isShowBottom">
            <dic-input
              :keyWord="$u.dic.DIC_KEYS.SPECIAL"
              :dicCode="confirmInfo.specialGroupType"
              :border="false"
              type="select"
              :select-open="dicMultiSelectOpen('group',$u.dic.DIC_KEYS.SPECIAL)"
              placeholder="请选择"
              :disabled="true"
              v-model="confirmInfo.specialGroupName"
              @changeInputModelData="(name)=>{$set(confirmInfo, 'specialGroupName', name)}"
              @click="showMultiDic($u.dic.DIC_KEYS.SPECIAL,confirmInfo.specialGroupType,'group')"
            />
          </u-form-item>
        </view>

        <u-form-item
          label="其他群体类型"
          :required="isRequired"
          :label-width="labelWidth"
          label-position="top"
          prop="specialGroupTypeOther"
          v-if="confirmInfo.isSpecialGroupTypeOther"
        >
          <u-input placeholder="请填写" :disabled="isDisable" v-model="confirmInfo.specialGroupTypeOther" />
        </u-form-item>
        <u-form-item
          label="地区类型"
          :label-width="labelWidth"
          label-position="top"
          right-icon="arrow-right"
          :required="isRequired"
          prop="areaTypeName"
          ref="areaRef"
        >
          <u-select
            :list="AREA_TYPE"
            mode="single-column"
            v-model="isAreaShow"
            @confirm="selectConfirm('areaType','areaTypeName',$event)"
          ></u-select>
          <u-input
            :clearable="false"
            :disabled="true"
            placeholder="请选择"
						:custom-style="pointerStyle"
            v-model="confirmInfo.areaTypeName"
            @click="isAreaShow = !isDisable"
          />
        </u-form-item>
        <u-form-item label="经营面积(m²)" label-position="top" prop="bizArea" :label-width="labelWidth">
          <u-input placeholder="请填写" :disabled="isDisable" v-model="confirmInfo.bizArea" />
        </u-form-item>
        <u-form-item label="业态" :label-width="labelWidth" label-position="top" :required="isRequired" prop="bizFormatName">
          <dic-input
            :keyWord="$u.dic.DIC_KEYS.FORMAT"
            :dicCode="confirmInfo.bizFormat"
            type="select"
            :border="border"
            :select-open="dicSelectOpen('biz',$u.dic.DIC_KEYS.FORMAT)"
            placeholder="请选择"
            v-model="confirmInfo.bizFormatName"
            @changeInputModelData="(name)=>{$set(confirmInfo, 'bizFormatName', name)}"
            @click="showDic($u.dic.DIC_KEYS.FORMAT,confirmInfo.bizFormat,'biz')"
          />
        </u-form-item>
        <u-form-item label="业态细分" :label-width="labelWidth" label-position="top" :required="isRequired" prop="bizFormatDetailName">
          <view class="uni-list-cell-db" style="width:100%;">
            <picker @change="bindBizFDetailPickerChange" :value="bizfDetailIndex" :range="bizFormatDetailList" range-key="text">
              <view class="uni-input">
                {{ confirmInfo.bizFormatDetailName||'请选择' }}
              </view>
            </picker>
          </view>
        </u-form-item>
        <u-form-item label="商圈类型" :label-width="labelWidth" label-position="top" :required="false" prop="busiTypeName">
          <dic-input
            :keyWord="$u.dic.DIC_KEYS.L_BUSI_TYPE"
            :dicCode="confirmInfo.busiType"
            type="select"
            :border="border"
            :select-open="dicSelectOpen('busiT',$u.dic.DIC_KEYS.L_BUSI_TYPE)"
            placeholder="请选择"
            v-model="confirmInfo.busiTypeName"
            @changeInputModelData="(name)=>{$set(confirmInfo, 'busiTypeName', name)}"
            @click="showDic($u.dic.DIC_KEYS.L_BUSI_TYPE,confirmInfo.busiType,'busiT')"
          />
        </u-form-item>
        <u-form-item :label-width="labelWidth" label="安全隐患">
          <u-switch
            :disabled="isDisable"
            slot="right"
            v-model="confirmInfo.isSecurityProblems"
            @change="switchChange($event,'isSecurityProblems','securityProblemsInstruction')"
          ></u-switch>
        </u-form-item>
        <u-form-item label="(安全隐患)说明" :label-position="labelPosition" v-if="confirmInfo.isSecurityProblems">
          <u-input placeholder="请填写" v-model="confirmInfo.securityProblemsInstruction" />
        </u-form-item>
        <u-form-item :label-width="labelWidth" :required="scopeList.includes(confirmInfo.managerScope)" prop="isECigarPlace" label="限制性经营场所（电子烟）">
          <!-- <u-switch
            :disabled="isDisable"
            slot="right"
            v-model="confirmInfo.isECigarPlace"
            @change="switchChange($event,'isECigarPlace','ecigarPlaceInstruction')"
          ></u-switch> -->
          <u-radio-group slot="right" v-model="confirmInfo.isECigarPlace" :disabled="isDisable">
            <u-radio 
              v-for="(item, index) in radioList" 
              :key="index"
              @change="radioChange($event,'isECigarPlace','ecigarPlaceInstruction')" 
              :name="item.value"
            >
              {{ item.name }}
            </u-radio>
          </u-radio-group>
        </u-form-item>
        <u-form-item label="(限制性经营场所)说明" :required="isRequired" :label-position="labelPosition" v-if="confirmInfo.isECigarPlace == '1'" prop="ecigarPlaceInstruction">
          <u-input placeholder="请填写" v-model="confirmInfo.ecigarPlaceInstruction" />
        </u-form-item>
        <u-form-item :label-width="labelWidth" :required="scopeList.includes(confirmInfo.managerScope)" prop="isECigarScope" label="限制性主营业务（电子烟）">
          <!-- <u-switch
            :disabled="isDisable"
            slot="right"
            v-model="confirmInfo.isECigarScope"
            @change="switchChange($event,'isECigarScope','ecigarScopeInstruction')"
          ></u-switch> -->
          <u-radio-group slot="right" v-model="confirmInfo.isECigarScope" :disabled="isDisable">
            <u-radio 
              v-for="(item, index) in radioList" 
              :key="index"
              @change="radioChange($event,'isECigarScope','ecigarScopeInstruction')" 
              :name="item.value"
            >
              {{ item.name }}
            </u-radio>
          </u-radio-group>
        </u-form-item>
        <u-form-item label="(限制性主营业务)说明" :required="isRequired" :label-position="labelPosition" v-if="confirmInfo.isECigarScope == '1'" prop="ecigarScopeInstruction">
          <u-input placeholder="请填写" v-model="confirmInfo.ecigarScopeInstruction" />
        </u-form-item>
        <u-form-item :label-width="labelWidth" label="品牌连锁便利店" :required="isRequired" prop="isConvenientStore">
          <u-switch
            :disabled="isDisable"
            slot="right"
            v-model="confirmInfo.isConvenientStore"
            @change="switchChange($event,'isConvenientStore', 'storeBrand')"
          ></u-switch>
        </u-form-item>
        <u-form-item label="(品牌连锁便利店)说明" :required="isRequired" :label-position="labelPosition" v-if="confirmInfo.isConvenientStore" prop="storeBrand">
          <u-input placeholder="请填写" v-model="confirmInfo.storeBrand" />
        </u-form-item>
        <u-form-item :label-width="labelWidth" label="固定场所" :required="isRequired" prop="isFixedPlace">
          <u-switch
            :disabled="isDisable"
            slot="right"
            v-model="confirmInfo.isFixedPlace"
            @change="switchChange($event,'isFixedPlace')"
          ></u-switch>
        </u-form-item>
        <u-form-item :label-width="labelWidth" label="是否与住所独立" :required="isRequired" prop="isAlone">
          <u-switch
            :disabled="isDisable"
            slot="right"
            v-model="confirmInfo.isAlone"
            @change="switchChange($event,'isAlone')"
          ></u-switch>
        </u-form-item>
        <!-- 多选框  right-icon="arrow-right"-->
        <u-form-item label="合理布局照顾政策" :label-position="labelPosition">
          <dic-input
            :keyWord="$u.dic.DIC_KEYS.L_LAYOUT_POLICY_TYPE"
            :dicCode="confirmInfo.licenseBasis"
            type="select"
            :border="border"
            :select-open="dicSelectOpen('bas',$u.dic.DIC_KEYS.L_LAYOUT_POLICY_TYPE)"
            placeholder="请选择"
            v-model="confirmInfo.licenseBasisStr"
            @changeInputModelData="(name)=>{$set(confirmInfo, 'licenseBasisStr', name)}"
            @click="showDic($u.dic.DIC_KEYS.L_LAYOUT_POLICY_TYPE,confirmInfo.licenseBasis,'bas')"
          />
        </u-form-item>
        <!-- 新加字段  -->
        <u-form-item label="最近零售户" label-position="top" prop="nearbyRetailers" :label-width="labelWidth">
          <u-input placeholder="请填写" :disabled="isDisable" v-model="confirmInfo.nearbyRetailers" />
        </u-form-item>
        <u-form-item label="最近零售户距离(米)" label-position="top" prop="nearbyRetailersDistance" :label-width="labelWidth">
          <u-input placeholder="请填写" :disabled="isDisable" v-model="confirmInfo.nearbyRetailersDistance" @input="nearbyRetailersDistanceChange" />
        </u-form-item>
        <u-form-item label="其他是否符合属地合理布局规划情况" :label-position="labelPosition">
          <u-input type="textarea" placeholder="请填写" :disabled="isDisable && !isDocUpdAble" v-model="confirmInfo.rationalLayoutCondition" />
        </u-form-item>
        <template v-if="fieldData.applyType == '01' && !isElectronicCigarette">
          <template v-if="showChooseGrid && gridLayoutInfo &&  (gridLayoutInfo.preOrApproval == '02' ||gridLayoutInfo.preOrApproval == '99')">
            <u-form-item
              label="所属单元"
              :required="isRequired"
              label-position="top"
              prop="gridName"
              :label-width="labelWidth">
              <!-- 方位图回填 此处只读处理 -->
              <u-input  placeholder="支持模糊搜索查询单元" v-model="confirmInfo.gridName" @search="onSearch" @input="onSearch" disabled/>
              <!-- <u-input   v-model="confirmInfo.gridUuid" type=/> -->
              <!-- 搜索结果列表 -->
              <view class="grid-list-laz" v-if="showGridList" @touchstart="touchStart">
                <view class="each-grid" @click="eachGridClick(item)" v-for="(item, index) in searchGridNames" :key="index">
                  {{ item.gridName }} <text>剩余可办数量({{item.licAvailableQty}})</text>
                </view>
              </view>
            </u-form-item>
          </template>
          <u-form-item
            label="放宽名单"
            prop="isSpecialClause"
            v-if="showFKMD"
            label-position="left"
            :label-width="labelWidth">
            <u-switch
              :disabled="isDisable"
              slot="right"
              v-model="confirmInfo.isSpecialClause"
              @change="isSpecialClauseChange($event,'isSpecialClause')"
            ></u-switch>
          </u-form-item>
          <u-form-item
            label="放宽情形"
            class="search-area"
            :required="isRequired"
            v-if="confirmInfo.isSpecialClause"
            label-position="top"
            prop="specialClauseName"
            :label-width="labelWidth">
            <u-select
              :list="specialClauseList"
              mode="single-column"
              v-model="specialClauseShow"
              @confirm="selectConfirm('specialClauseUuid','specialClauseName',$event)"
            ></u-select>
            <u-input
              :clearable="false"
              :disabled="true"
              placeholder="请选择放宽情形"
              :custom-style="pointerStyle"
              v-model="confirmInfo.specialClauseName"
              @click="specialClauseShow = !isDisable"
            />
          </u-form-item>
          <!-- 增加新小区 -->
          <!-- 1、初始化选择时 caseType == '01' -->
          <!-- 2、回显时：isSpecialClause && confirmInfo.specialClauseUuid && confirmInfo.newCommunityName -->
          <u-form-item
            label="新小区"
            class="search-area"
            :required="caseType == '01'"
            v-if="caseType == '01' || confirmInfo.isSpecialClause && ((confirmInfo.specialClauseUuid && confirmInfo.newCommunityName))"
            label-position="top"
            prop="newCommunityName"
            :label-width="labelWidth">
            <u-select
              :list="newCommunityList"
              mode="single-column"
              v-model="newCommunityShow"
              @confirm="selectConfirm('newCommunityUuid','newCommunityName',$event)"
            ></u-select>
            <u-input
              :clearable="false"
              :disabled="true"
              placeholder="请选择新小区"
              :custom-style="pointerStyle"
              v-model="confirmInfo.newCommunityName"
              @click="newCommunityShow = !isDisable"
            />
          </u-form-item>
          <!-- 增加新小区 -->
        </template>
        <u-form-item
          :label-width="labelWidth"
          label="实地核查意见(是否符合)"
          :required="isRequired"
          prop="fieldAuditDecide"
          label-position="top"
        >
          <u-radio-group v-model="fieldAuditVal" :disabled="isDisable" @change="radioGroupChange">
            <u-radio
              :name="item.value"
              v-for="(item, index) in fieldAuditDecideList"
              :key="index"
            >
              {{ item.name }}
            </u-radio>
          </u-radio-group>
        </u-form-item>
        <u-form-item label="实地核查意见内容" :label-position="labelPosition">
          <u-input
            placeholder="请填写实地核查意见内容"
            :disabled="isDisable && !isDocUpdAble"
            type="textarea"
            v-model="confirmInfo.fieldAuditDecideContent"
          />
        </u-form-item>
        <!-- v-if="fieldData.applyType != 'L0103'" -->
        <u-form-item
          :label-width="labelWidth"
          label="是否涉及重大行政许可"
          :required="isRequired"
          prop="isImportLic"
        >
          <u-switch
            :disabled="isDisable"
            slot="right"
            v-model="confirmInfo.isImportLic"
            @change="switchChange($event,'isImportLic')"
          ></u-switch>
        </u-form-item>
        <!-- v-if="fieldData.applyType != 'L0103' && confirmInfo.isImportLic == true" -->
        <u-form-item
          label="重大许可项"
          :label-width="labelWidth"
          v-show="confirmInfo.isImportLic"
          :label-position="labelPosition"
        >
          <dic-input
            :keyWord="$u.dic.DIC_KEYS.L_IMPORT_LIC_CONTENT"
            :dicCode="confirmInfo.isImportLicContent"
            type="select"
            :border="border"
            :select-open="dicSelectOpen('lic',$u.dic.DIC_KEYS.L_IMPORT_LIC_CONTENT)"
            placeholder="请选择"
            v-model="confirmInfo.isImportLicName"
            @changeInputModelData="(name)=>{$set(confirmInfo, 'isImportLicName', name)}"
            @click="showDic($u.dic.DIC_KEYS.L_IMPORT_LIC_CONTENT,confirmInfo.isImportLicContent,'lic')"
          />
        </u-form-item>
        <u-form-item label="核查时间" :label-width="labelWidth" label-position="top" right-icon="arrow-right" ref="fieldDateRef">
          <u-input
            placeholder="请选择日期"
            :disabled="isDisabled"
            v-model="confirmInfo.fieldAuditTime"
            @click="clicDatekHandle('isShowField')"
          />
        </u-form-item>
        <u-form-item label="被核查时间" :label-width="labelWidth" label-position="top" right-icon="arrow-right" ref="passiveDateRef">
          <u-input
            placeholder="请选择日期"
            :disabled="isDisabled"
            v-model="confirmInfo.passiveCheckTime"
            @click="clicDatekHandle('isShowPassive')"
          />
        </u-form-item>
        <u-form-item label="被核查方" label-position="top" prop="passiveCheckPersonName" :label-width="labelWidth">
          <u-input
            placeholder="请输入被检查方"
            :disabled="isDisable"
            v-model="confirmInfo.passiveCheckPersonName"
          />
        </u-form-item>
        <u-form-item label="经营地址图" :label-position="labelPosition" :required="isRequired">
          <m-upload
            :deletable="!isDisable"
            :disabled="isDisable"
            width="150rpx"
            height="150rpx"
            :file-list="addrImgs"
            :multiple="true"
            index="addrImgs"
            :uploadParam="{bizId:docIns.bizUuid,fiGroupCode:$FILE_GROUP_TYPE.l_audit_addr_img,fiLogicPath:$FILE_GROUP_TYPE.l_audit_addr_img}"
            ref="deskPicUpload"
            @on-list-change="changeUpload"
          >
          </m-upload>
        </u-form-item>

        <u-form-item label="经营场所图" :label-position="labelPosition">
		<view >
          <m-upload
            :deletable="!isDisable"
            :disabled="isDisable"
            width="150rpx"
            height="150rpx"
            :file-list="placeImgs"
            :uploadParam="{bizId:docIns.bizUuid,fiGroupCode:$FILE_GROUP_TYPE.l_audit_place_img,fiLogicPath:$FILE_GROUP_TYPE.l_audit_place_img}"
            :multiple="true"
            index="placeImgs"
            ref="gatePicUpload"
            @on-list-change="changeUpload"
          >
          </m-upload>
		  <view v-if="isShowSginOrDraw && !isDisable" @tap="selectDraw" style="display: block;">
		    <slot name="addBtn"></slot>
		    <view
		      class="m-list-item m-add-wrap"
		      hover-class="m-add-wrap__hover"
		      hover-stay-time="150"
		      style="width: 150rpx;height: 150rpx"
		    >
		      <u-icon name="edit-pen-fill" class="m-add-btn" size="40"></u-icon>
		      <view class="m-add-tips">
		        在线画图
		      </view>
		    </view>
		  </view>
		</view>
		  
        </u-form-item>

        <u-form-item label="其他图片" :label-position="labelPosition" class="btom">
          <m-upload
            :deletable="!isDisable"
            :disabled="isDisable"
            width="150rpx"
            height="150rpx"
            :file-list="otherImgs"
            :uploadParam="{bizId:docIns.bizUuid,fiGroupCode:$FILE_GROUP_TYPE.l_audit_other_img,fiLogicPath:$FILE_GROUP_TYPE.l_audit_other_img}"
            :multiple="true"
            index="otherImgs"
            ref="carPicUpload"
            @on-list-change="changeUpload"
          >
          </m-upload>
        </u-form-item>
		<u-form-item label="手写签名" :label-position="labelPosition" class="btom" v-if="isShowSginOrDraw">
		  <!-- <view
		    style="display: flex;flex-direction: row;justify-content: flex-end;width: 100%;"
		    @click="showSignView"
		  > -->
		   <signUpload 
			ref="sign" 
			:header="header" 
			:action="action" 
			:deletable="!isDisable"
			:file-list="sginImgs"
			width="150rpx"
			height="150rpx"
			index="sginImgs"
			:uploadParam="{bizId:docIns.bizUuid,fiGroupCode:$FILE_GROUP_TYPE.l_audit_check_person_img,fiLogicPath:$FILE_GROUP_TYPE.l_audit_check_person_img}"
			@signToUrl="signToUrl">
		    </signUpload>
		  <!-- </view> -->
		  
		</u-form-item>
		
      </u-form>
    </view>
    <!-- 合理布局选择框 -->
    <u-popup mode="bottom" border-radius="14" height="80%" v-model="layoutShow">
      <multi-select :options="layoutOptions" :defaultUids="defaultUids" @select="handlerSelectlayout">
      </multi-select>
    </u-popup>
    <!-- 数据字典 -->
    <dic-choice
      :keyWord="dicKeyWords"
      :hasNeedNull="hasNeedNull"
      :currentSelect="dicCurrentSelect"
      v-model="dicShow"
      @confirm="selectDicConfirm"
    ></dic-choice>
    <!-- 多选字典组件 -->
    <u-popup mode="bottom" height="50%" v-model="mulitChoiceShow">
      <dic-multi-choice
        :otherLogic="true"
        :logicFun="logicFun"
        :keyWord="dicKeyWords"
        :defaultUids="dicCurrentSelect"
        @select="multiChoiceConfirm"
      >
      </dic-multi-choice>
    </u-popup>
    <u-calendar mode="date" v-model="isShowCyBeginStart" @change="changeDate('tenancyBeginDate',$event)">
    </u-calendar>
    <u-calendar mode="date" :min-date="showCyEndMin" :max-date="maxDate" v-model="isShowCyBeginEnd" @change="changeDate('tenancyEndDate',$event)">
    </u-calendar>
    <u-calendar
      :mode="mode"
      :max-date="maxDate"
      v-model="isShowField"
      @change="changeDate('fieldAuditTime',$event)"
    >
    </u-calendar>
    <u-calendar
      :mode="mode"
      :max-date="maxDate"
      v-model="isShowPassive"
      @change="changeDate('passiveCheckTime',$event)"
    >
    </u-calendar>
  </view>
</template>

<script>
import DicChoice from "@/components/dic_choice.vue";
import DicInput from "@/components/dic_input.vue";
import DicMultiChoice from "@/components/dic_multi_choice.vue";
import mUpload from '@/components/m-upload.vue';
import multiSelect from '@/components/multi-select.vue';
import commonService from "@/service/common/common.service.js";
import rspService from "@/service/rsp/rsp.service.js";
import {  M_DOC_UPD_STATUS,AREA_TYPE,DICT_ENUM,} from '@/service/certificate/mapping/enum.js';
import certificateService from "@/service/certificate/certificate.service.js";
import AutoInput from "@/components/autoInput.vue";
import signUpload from "@/components/sign/z-sign-upload.vue";
export default {
  components: {
    "dic-choice": DicChoice,
    "dic-input": DicInput,
    mUpload,
    multiSelect,
    DicMultiChoice,
    AutoInput,
	signUpload
  },
  props: {
    fieldData: {
      type: Object,
      default: () => {
        return {};
      },
    },
    docIns: {
      type: Object,
      default: () => {
        return {};
      },
    },
    docUpdateStatus:{
      type: String,
      default:"",
    },
    isLicDecide:{
      type: [String, Boolean,],
      default: "",
    },
    isElectronicCigarette:{
      type:Boolean,
      default:false,
    },
  },
  data() {
    return {
      mainInfoObj: {}, // 用来存maininfobyid查询的数据
      showFKMD: false,
      showChooseGrid: false,
      gridLayoutInfo: '', // 合理化布局配置信息
      searchGridNames: [],
      showGridList: false,
      specialClauseShow: false,
      specialClauseList: [],
      newCommunityShow: false,
      newCommunityList:[],//新小区列表
      user: this.$store.state.userInfo,
      mulitChoiceShow: false, // 多选弹出框show
      AREA_TYPE,
      DICT_ENUM,
      IMPORT_LIC_DATA: [],
      layoutShow: false,
      layoutOptions: [],
      defaultUids: [],
      isShowBottom: false,
      pickerShow:false,
      list:[],
      areaArray: [], // 默认回显的省市县组件
      fieldAuditVal:"",
      fieldAuditDecideList:[
        {
          value:'1',
          name:"实地核查通过",
        },
        {
          value:'0',
          name:"实地核查不通过",
        },
      ],
      border: false,
      labelPosition: 'top',
      labelStyle: {
        fontWeight: 400,
        color: this.$theme.u_main_color,
        // fontSize: '.75rem',
      },
      rightIconStyle: {
        'fontSize': '40rpx',
        'color': this.$theme.u_type_primary,
      },
      labelWidth: '360',
      errorType: ['border-bottom','message',],
      townDefaultVal: 0,
      villageDefaultVal: 0,
      // 校验规则
      rules: {
        businessAddrStreet: [{
          required: true,
          message: '请输入经营地址',
          trigger: ['change', 'blur',],
        },],
        town: [{
          required: true,
          message: '请选择所属街道（乡镇）',
          trigger: 'change',
        },],
        village: [{
          required: true,
          message: '请选择社区（行政村）',
          trigger: 'change',
        },],
        groundOwnershipName: [{
          validator: (rule, value, callback) => {
            return this.$u.test.isEmpty(value) ? false : true;
          },
          message: '请选择场地权属',
          trigger: 'change',
        },],
        // 工商营业执照日期
        tenancyDate: [{
          validator: (rule, value, callback) => {
            if ((this.confirmInfo.groundOwnershipType == '02' || this.confirmInfo
              .groundOwnershipType == '03') && this.confirmInfo.isLongTenancy == true) {
              if (!this.$u.test.isEmpty(value)) return true;
              return false;
            } else {
              return true;
            }
          },
          message: '请选择租赁期限',
          trigger: ['change', 'blur',],
        },],
        specialGroupTypeOther: [{
          validator: (rule, value, callback) => {
            if (this.confirmInfo.specialGroupType.indexOf('08') != -1 && this.$u.test.isEmpty(
              value)) {
              return false;
            } else {
              return true;
            }
          },
          message: '请填写其他群体类型',
          trigger: ['change', 'blur',],
        },],
        areaTypeName: [{
          required: true,
          message: '请选择地区类型',
          trigger: 'change',
        },],
        bizFormatName: [{
          required: true,
          message: '请选择业态',
          trigger: 'change',
        },],
        bizFormatDetailName: [{
          required: true,
          message: '请选择业态细分',
          trigger: 'change',
        },],
        securityProblemsInstruction: [{
          validator: (rule, value, callback) => {
            if (!this.confirmInfo.isSecurityProblems && this.$u.test.isEmpty(value)) {
              return false;
            } else {
              return true;
            }
          },
          message: '请填写(安全隐患)说明',
          trigger: ['change', 'blur',],
        },],
        signNameFileId: [{
          validator: (rule, value, callback) => {
            // 证件类型选择身份证，校验身份证号
            if (this.btnType != 'save' && !this.isDisable) {
              return !this.$u.test.isEmpty(value);
            } else {
              return true;
            }
          },
          message: '被核查方签名',
          trigger: ['change', 'blur',],
        },],
        ecigarPlaceInstruction: [{
          required: true,
          message: '请输入',
          trigger: ['change', 'blur',],
        },],
        ecigarScopeInstruction: [{
          required: true,
          message: '请输入',
          trigger: ['change', 'blur',],
        },],
        storeBrand: [{
          required: true,
          message: '请输入',
          trigger: ['change', 'blur',],
        },],
        tenancyBeginDate: [{
          required: true,
          message: '请选择',
          trigger: ['change', 'blur',],
        },],
        gisXY: [{
          required: true,
          message: ' ',
          trigger: ['change', 'blur',],
        },],
        bizArea: [{
          validator: (rule, value, callback) => {
            if(this.$u.test.isEmpty(value)){
              return true;
            }{
              let regs = /^[0-9]+([.]{1}[0-9]+){0,1}$/;
              return regs.test(value);
            }
          },
          message: '经营面积格式不正确',
          trigger: ['change', 'blur',],
        },],
        nearbyRetailers: [{
          required: true,
          message: '请输入',
          trigger: ['change', 'blur',],
        },],
        nearbyRetailersDistance:[{
          validator: (rule, value, callback) => {
            if(this.$u.test.isEmpty(value)){
              return false;
            }{
              let regs = /^[0-9]+([.]{1}[0-9]+){0,1}$/;
              return regs.test(value);
            }
          },
          message: '附近零售户距离格式不正确',
          trigger: ['change', 'blur',],
        },],
        // 放宽条款的下拉框
        specialClauseName: [{
          required:true,
          message: '请选择放宽情形',
          trigger: ['change', 'blur',],
        },],
        // 所属网格
        gridName: [{
          required:true,
          message: '请选择需要归属的单元',
          trigger: ['change', 'blur',],
        },],
      },
      dicType: '',
      dicShow: false, // dic_select 是否显示
      hasNeedNull:false,
      dicKeyWords: "", // dic 关键字
      dicCurrentSelect: "", // dic 当前选择项
      mode: 'date',
      maxDate: '2099-12-31',
      isDisabled: true,
      isRequired: true,
      showCyEndMin:this.$u.date(Date.now(), "yyyy-mm-dd"),
      isShowCyBeginStart: false,
      isShowCyBeginEnd: false,
      isShowField: false,
      isShowPassive: false,
      townShow: false,
      villageShow: false,
      isAreaShow: false,
      importLicShow: false,
      isImportLic: false,
      isSpecialGroupTypeOther: false,
      streetData: [],
      villagesData: [],
      ownershipOptions: [],
      confirmInfo: {
        tenancyDate: "",
        isLongTenancy: false,
        managerScope:"",
        isSpecialClause: false,
        specialClauseUuid: '',
        specialClauseName: '',
        gridUuid: '',
        gridName: ''
      },
      addrImgs: [],
      placeImgs: [],
      otherImgs: [],
      managerPhoto:[],
      dictType: 'L_LAYOUT_POLICY_TYPE',
      importLicContent: 'L_LICENSING_MATTERS',
      // disable:true,
      isDisable: true, // 表示 是不是队长
      isShowSignView: false,
      signImgList: [],
      btnType: "",
      streetValue:"",
      isDocUpdAble: false, // 文书删改状态 true ，则只能修改部分内容
      scopeList:['05',],
      radioList:[
        {
          name: '否',
          value: '0',
        },{
          name: '是',
          value: '1',
        },],
	    bizfDetailIndex:0,// 选中的业态细分
      bizFormatDetailList:[],// 业态细分
		// h5端部分浏览器input设置disabled后点击事件失效 2023-10-27 fsx start
		pointerStyle: {
		marginRight: "5px",
		pointerEvents: "none !important"
		},
		// h5端部分浏览器input设置disabled后点击事件失效 2023-10-27 fsx end
		action: "", //上传服务器的地址
		header: {}, //图片上传携带头部信息
		// 在线画图 以及 在线签名 2024-6-3 开始
		sginImgs:[],
		isShowSginOrDraw:false,
		// 在线画图 以及 在线签名 2024-6-3 结束
    caseType: '',
    distance:''
    };
  },
  onLoad() {},
  watch: {
    isShowCyBegin(newValue, oldValue) {
      this.$refs.startChangeRef.validation();
    },
    docUpdateStatus(newValue, oldValue){
      if(this.docIns.step == 'assigntask'){
        this.isDisable = true;
        this.isDocUpdAble = true;
      }else if(this.docIns.step == 'sitecheck'){
        let iDUA =  newValue == M_DOC_UPD_STATUS.UPDATING && this.isLicDecide; // 表示决定书后的文书删改状态
        if(iDUA){
          this.isDisable = true;
          this.isDocUpdAble = true;
        }else{
          this.isDisable = false;
          this.isDocUpdAble = false;
        }
      }else{
        this.isDisable = true;
        this.isDocUpdAble = false;
      }
    },
    docIns(newValue, oldValue) {
      this.isDisable = newValue.step == 'assigntask' || newValue.step == 'view';
    },
    fieldData(newValue, oldValue) {
      try{
        if(!this.$u.test.isEmpty(newValue.businessAddrAdc)){
          let arCode = newValue.businessAddrAdc.split(',');
          let loc = commonService.getPersonLocal(arCode[arCode.length - 1], true);
          if(this.$modal.isMuniCity(loc.proCode)){
            this.confirmInfo.region =  loc.admdivName + loc.countryName;
          }else{
            this.confirmInfo.region =  loc.proName + loc.admdivName + loc.countryName;
          }
          this.streetValue = newValue.businessAddrStreet
          this.$emit('newStreet',loc.countryCode)
        }
        if (newValue.bizFormat) {
          this.loadBizFormatDetail(newValue.bizFormat)
        }
        if(newValue.bizFormatDetail){
          for (const key in DICT_ENUM.L_BIZ_FORMAT_DETAIL) {
            if (Object.hasOwnProperty.call(DICT_ENUM.L_BIZ_FORMAT_DETAIL, key)) {
              const element = DICT_ENUM.L_BIZ_FORMAT_DETAIL[key];
              if (newValue.bizFormatDetail == element) {
                this.confirmInfo.bizFormatDetailName = DICT_ENUM.L_BIZ_FORMAT_DETAIL[key + '_CN']
              }
            }
          }
        }
      }catch(e){ console.log(e); }
      if (newValue.signImgList) {
        this.signImgList = newValue.signImgList;
      }
    },
    deep: true,
  },
  created() {
    // 合理化布局配置，用来做所属网格的显示
    commonService.getSysConfig('hlhbj','is_open_layout').then(res=>{
      console.log(res, '当前的所属单元的显示')
      this.showChooseGrid = res.msg == '1'
    })
    commonService.getGridLayoutInfo({ ownOrgUuid: this.user.orgUuid }).then(res=>{
      console.log(res, '获取合理化布局配置信息')
      this.gridLayoutInfo = res.bean || ''
    })
    // 合理布局dict初始化
    commonService.bscCodesMap(this.dictType).then(dr => {
      if (dr.success) {
        let ps = dr.bean[this.dictType];
        ps.map(p => {
          p.uid = p.bcbCode;
          p.name = p.bcbName;
          p.exts = [p.bcbCode, p.bcbName,];
        });
        this.$nextTick(() => this.layoutOptions = ps);
      }
    });
    commonService.bscCodesMap(this.importLicContent).then(res => {
      if (res.success) {
        let ps = res.bean[this.importLicContent];
        this.IMPORT_LIC_DATA = ps.map(p => {
          return {
            value: p.id,
            label: p.name,
          }
        });
      }
    }),
	// 在线画图 以及 在线签名 配置项 2024-6-3 开始
	commonService.getSysConfig("L_RLIC","fieldAuditcheckPersonOrg").then(res=>{
		if(res.code == 0 && res.success && res.msg) {
		    let code = res.msg;
			if(!!code && code.indexOf(this.user.orgCode) > -1) {
				this.isShowSginOrDraw = true
			} else {
				this.isShowSginOrDraw = false
			}
		} else {
			this.isShowSginOrDraw = false
		}
	})
	// 在线画图 以及 在线签名 配置项 2024-6-3 开始
  },
  mounted() {
    this.$refs.uForm.setRules(this.rules);
  },
  methods: {
    // 选择是否放宽名单
    isSpecialClauseChange(val, key) {
      if(val){
        // 说明选择了是   进行放宽情形列表的获取
      } else {
        // 说明是否
        this.confirmInfo.specialClauseName = ''
        this.confirmInfo.specialClauseUuid = ''
        this.confirmInfo.newCommunityName = ''
        this.confirmInfo.newCommunityUuid = ''
      }
    },
    touchStart(e) {
      console.log('==touchStart==');
      this.showGridList = true;
    },
    // 点击任何一个网格
    eachGridClick(item) {
      this.confirmInfo.gridName = item.gridName || ''
      this.confirmInfo.gridUuid = item.gridUuid || ''
      console.log(this.confirmInfo.gridUuid,'this.confirmInfo.gridUuid');
      this.getNewCommunityList(this.confirmInfo.gridUuid)
      this.searchGridNames = []
      this.showGridList = false
    },
    onSearch(val) {
      // 发送请求到远程服务器
      this.fetchSearchResults(val).then(results => {
        this.searchGridNames = results;
        this.showGridList= true
      },err=>{
        this.searchGridNames = []
        this.showGridList= false
      }).catch(error => {
        console.error('Search error:', error);
      });
    },
    fetchSearchResults(query) {
      // 这里使用mock数据模拟远程请求
      this.$modal.hideLoading()
      return new Promise((resolve, reject) => {
        if (query) {
          this.$modal.showLoading('请求中...');
          this.searchGridNames = []
          this.showGridList = false
          const params = {
            page:1,
            limit: 10,
            gridName: query
          }
          this.$u.debounce(()=>{
            rspService.getGridNameList(params).then(res=>{
              console.log('查询出来的', res)
              this.$modal.hideLoading()
              if(res.success) {
                resolve(res.data || [])
              } else {
                resolve([])
              }
            })
          }, 2000)
        } else {
          reject(false)
        }
      });
    },
    viewGridName(mainInfoObj){
      this.confirmInfo.gridUuid = mainInfoObj.gridUuid
      this.getNewCommunityList()
      if (mainInfoObj.gridUuid) {
        rspService.getGridInfoById({gridUuid: mainInfoObj.gridUuid}).then(res=>{
          if (res.success) {
            this.confirmInfo.gridName = res.bean.gridName || ''
          }
        })
      }
    },
    initAreaCitys(newData){
      this.list = [];
      this.list.push({
        value: this.user.topAreaCode,
        text: this.user.topAreaName,
        children:[],
      });
      // 说明有所属网格，需要查询来返显
      commonService.queryAreaBaseByCode(this.user.user.org.orgUuid).then(res => {
        if(res.success && res.bean){ // 获取当前部门对应的市局数据
          this.list[0].children = [{
            value: res.bean.admdivcode,
            text: res.bean.admdivname,
            children:[],
          },];
          commonService.countries(res.bean.admdivcode).then(rs => {
            if(rs.success && rs.data.length > 0){
              this.list[0].children[0].children = [...rs.data,];
              let adcs = this.fieldData && this.fieldData.businessAddrAdc ? this.fieldData.businessAddrAdc.split(",") : [];
              let code = adcs[adcs.length - 1];
              let areaObj = commonService.getPersonLocal(code,true);
              if(!this.isDisable && !areaObj.countryCode){
                let arr = [];
                arr[0] = {
                  label:areaObj.proName,
                  value:areaObj.proCode,
                }
                arr[1] = {
                  label:areaObj.admdivName,
                  value:areaObj.admdivCode,
                }
                arr[2] = {
                  label:rs.data[0].text,
                  value:rs.data[0].value,
                }
                this.regionConfirm(arr)
              }else{
                this.areaArray = [0,0,0,];
              }
            }
          });
        }
      });
      //用来做放宽名单的显示
      commonService.getSysConfig('L_RLIC', 'specialClauseShowEnable').then(res=>{
        const specialFlag = res.msg && (
          res.msg.indexOf(this.user.orgCode) > -1 ||
          res.msg.indexOf(this.user.cityOrgCode) > -1 ||
          res.msg.indexOf(this.user.provOrgCode) > -1
        )
        this.showFKMD = specialFlag
        if(specialFlag){
          const params = {
            orgUuid: this.user.orgUuid,
            applyType: newData.applyType,
            docCode: 'lic-item-02-01-01'
          }
          rspService.getClauseCodes(params).then(r=>{
            if (r.success) {
              let list = r.data || []
              list = list.map(v=>{
                v.label = v.caseName
                v._value = v.value
                v.value = v.uuid
                return v
              })
              this.specialClauseList = list
              // 说明已经选过放宽情形了
              if(newData.specialClauseUuid) {
                let _thisList = []
                _thisList = list.filter(v=>{
                  return v.value == newData.specialClauseUuid
                })
                this.confirmInfo.specialClauseName = _thisList.length ? _thisList[0].label : ''
              }
            } else {
              this.specialClauseList = []
            }
          },e=>{
            this.specialClauseList = []
          })
        }
      })
    },
    // 选择地区回调
    regionConfirm(e) {
      if(this.$modal.isMuniCity(e[0].value)){
        this.confirmInfo.region =  e[1].label + e[2].label;
      }else{
        this.confirmInfo.region =  e[0].label + e[1].label + e[2].label;
      }
      let pt = e[0].value + ',' + e[1].value + ',' + e[2].value;
      if(this.confirmInfo.businessAddrAdc == pt) return;
      this.$set(this.confirmInfo,'businessAddrAdc',pt);
      this.$set(this.confirmInfo,'businessAddrStreet', this.confirmInfo.region || ''); // this.streetValue
      this.confirmInfo.town = "";
      this.confirmInfo.townCode = "";
      this.confirmInfo.villageCode = "";
      this.confirmInfo.village = "";
      this.$emit('getStreet',  e[2].value);
    },
    // 数据字典组件选择事件
    dicSelectOpen(type, keyWords) {
      if (type == this.dicType) {
        if (this.dicKeyWords == keyWords && this.dicShow) {
          return true;
        }
        return false;
      }
    },
    radioGroupChange(e){
      console.log(e);
      this.confirmInfo.fieldAuditDecide = e == '1';
      this.confirmInfo.fieldAuditDecideContent = this.confirmInfo.fieldAuditDecide ? '实地核查通过' : '实地核查不通过';
    },
    showDic: function(key, cur, type) {
      if (this.isDisable) return
      if (this.dicShow) return;
      this.dicType = type;
      this.dicKeyWords = key;
      this.hasNeedNull = this.dicKeyWords == this.$u.dic.DIC_KEYS.L_LAYOUT_POLICY_TYPE; // 如果是合理布局照顾正常选择,则可以置空
      this.dicCurrentSelect = cur;
      this.dicShow = true;
    },
    selectDicConfirm: function(e) {
      // 类型
      if (this.dicKeyWords == this.$u.dic.DIC_KEYS.FORMAT) {
        this.confirmInfo.bizFormatName = e[0].label;
        this.confirmInfo.bizFormat = e[0].extra.bcbCode;
        this.confirmInfo.bizFormatDetail = ''
        this.confirmInfo.bizFormatDetailName = ''
        this.loadBizFormatDetail(e[0].extra.bcbCode)
      }else if (this.dicKeyWords == this.$u.dic.DIC_KEYS.L_BUSI_TYPE){ // 商圈类型
        this.confirmInfo.busiTypeName = e[0].label;
        this.confirmInfo.busiType = e[0].extra.bcbCode;
      }else if (this.dicKeyWords == this.$u.dic.DIC_KEYS.L_IMPORT_LIC_CONTENT) {
        this.confirmInfo.isImportLicName = e[0].label;
        this.confirmInfo.isImportLicContent = e[0].extra.bcbCode;
      }else if (this.dicKeyWords == this.$u.dic.DIC_KEYS.L_LAYOUT_POLICY_TYPE) {
        this.confirmInfo.licenseBasisStr = e[0].label;
        this.confirmInfo.licenseBasis = e[0].extra.bcbCode;
      } else if (this.dicKeyWords == this.$u.dic.DIC_KEYS.OWNERSHIP) {
        this.confirmInfo.groundOwnershipName = e[0].label;
        this.confirmInfo.groundOwnershipType = e[0].extra.bcbCode;
        if (this.confirmInfo.groundOwnershipType == '01') {
          this.confirmInfo.isLongTenancy = true;
          this.confirmInfo.tenancyEndDate = "";
          this.confirmInfo.tenancyBeginDate = "";
          this.confirmInfo.tenancyDate = "";
        }else{
          this.confirmInfo.isLongTenancy = false;
          this.confirmInfo.tenancyEndDate = "";
          this.confirmInfo.tenancyBeginDate = "";
          this.confirmInfo.tenancyDate = "";
        }
      }
    },
    // 业态切换函数
    loadBizFormatDetail(bizFormatType) {
      switch (bizFormatType) {
      case DICT_ENUM.L_BIZ_FORMAT.CONVENIENCE_STORE:
        this.bizFormatDetailList = [{
          "value": DICT_ENUM.L_BIZ_FORMAT_DETAIL.MODERN_CHAIN_CONVENIENCE_STORES,
          "text": DICT_ENUM.L_BIZ_FORMAT_DETAIL.MODERN_CHAIN_CONVENIENCE_STORES_CN,
        }, {
          "value": DICT_ENUM.L_BIZ_FORMAT_DETAIL.MODERN_MONOMER_CONVENIENCE_STORES,
          "text": DICT_ENUM.L_BIZ_FORMAT_DETAIL.MODERN_MONOMER_CONVENIENCE_STORES_CN,
        }, {
          "value": DICT_ENUM.L_BIZ_FORMAT_DETAIL.TRADITIONAL_CONVENIENCE_STORES,
          "text": DICT_ENUM.L_BIZ_FORMAT_DETAIL.TRADITIONAL_CONVENIENCE_STORES_CN,
        },];
        break;
      case DICT_ENUM.L_BIZ_FORMAT.SURPER_MARKET:
        this.bizFormatDetailList = [{
          "value": DICT_ENUM.L_BIZ_FORMAT_DETAIL.SURPER_MARKET,
          "text": DICT_ENUM.L_BIZ_FORMAT_DETAIL.SURPER_MARKET_CN,
        },];
        break;
      case DICT_ENUM.L_BIZ_FORMAT.MARKET:
        this.bizFormatDetailList = [{
          "value": DICT_ENUM.L_BIZ_FORMAT_DETAIL.MARKET,
          "text": DICT_ENUM.L_BIZ_FORMAT_DETAIL.MARKET_CN,
        },];
        break;
      case DICT_ENUM.L_BIZ_FORMAT.TOBACCO_HOTEL:
        this.bizFormatDetailList = [{
          "value": DICT_ENUM.L_BIZ_FORMAT_DETAIL.TOBACCO_AND_ALCOHOL_STORES,
          "text": DICT_ENUM.L_BIZ_FORMAT_DETAIL.TOBACCO_AND_ALCOHOL_STORES_CN,
        }, {
          "value": DICT_ENUM.L_BIZ_FORMAT_DETAIL.PROFESSIONAL_CIGAR_STORE,
          "text": DICT_ENUM.L_BIZ_FORMAT_DETAIL.PROFESSIONAL_CIGAR_STORE_CN,
        }, {
          "value": DICT_ENUM.L_BIZ_FORMAT_DETAIL.ELECTRONIC_CIGARETTE_PROFESSIONAL_STORE,
          "text": DICT_ENUM.L_BIZ_FORMAT_DETAIL.ELECTRONIC_CIGARETTE_PROFESSIONAL_STORE_CN,
        }, {
          "value": DICT_ENUM.L_BIZ_FORMAT_DETAIL.OTHER_TOBACCO_SPECIALTY_STORES,
          "text": DICT_ENUM.L_BIZ_FORMAT_DETAIL.OTHER_TOBACCO_SPECIALTY_STORES_CN,
        },];
        break;
      case DICT_ENUM.L_BIZ_FORMAT.RECREATION_SERVICES:
        this.bizFormatDetailList = [{
          "value": DICT_ENUM.L_BIZ_FORMAT_DETAIL.HOTEL,
          "text": DICT_ENUM.L_BIZ_FORMAT_DETAIL.HOTEL_CN,
        }, {
          "value": DICT_ENUM.L_BIZ_FORMAT_DETAIL.RESTAURANT,
          "text": DICT_ENUM.L_BIZ_FORMAT_DETAIL.RESTAURANT_CM,
        }, {
          "value": DICT_ENUM.L_BIZ_FORMAT_DETAIL.LEISURE_AND_ENTERTAINMENT_STORES,
          "text": DICT_ENUM.L_BIZ_FORMAT_DETAIL.LEISURE_AND_ENTERTAINMENT_STORES_CN,
        },];
        break;
      case DICT_ENUM.L_BIZ_FORMAT.OTHER:
        this.bizFormatDetailList = [{
          "value": DICT_ENUM.L_BIZ_FORMAT_DETAIL.OTHER,
          "text": DICT_ENUM.L_BIZ_FORMAT_DETAIL.OTHER_CN,
        },];
        break;
      }
    },
    // 下拉框选择
    selectConfirm(type, name, e) {
      console.log(e,'e');
      this.confirmInfo[name] = '';
      this.confirmInfo[type] = '';
      let currentSpecialCause = []
      e.map((val, index) => {
        this.confirmInfo[type] = val.value;
        this.confirmInfo[name] = val.label;
        if(type == 'specialClauseUuid'){
          currentSpecialCause = this.specialClauseList.filter(item=>item.uuid == val.value)
          console.log(currentSpecialCause,'currentSpecialCause');
          if(currentSpecialCause.length > 0 ){
            this.caseType = currentSpecialCause[0]?.caseType
            this.distance = currentSpecialCause[0]?.distance
            console.log(this.distance,'caseType');
          }
          if(this.caseType == '01'){
            this.getNewCommunityList()
          }
        }

      });
      if (type == 'townCode') {
        this.$emit('ok', this.confirmInfo.townCode);
        this.$emit('showVal', this.confirmInfo.townCode, this.streetData, true);
      }
      if (type == 'villageCode'){
        this.$emit('showVal', this.confirmInfo.villageCode, this.villagesData, false); 
        // 新增提示内容 是队员 && 是新办 && 非电子烟任务 当选择社区后，调用接口提示信息
        if(!this.isDisable && this.fieldData.applyType == '01' && !this.isElectronicCigarette){
          this.checkMarginSufficient();
        }
      } 
      // 校验完成
      this.validatorFiled(type);

    },
    getNewCommunityList(gridUuid){
      console.log(this.confirmInfo.gridUuid,'this.confirmInfo.gridUuid');
      if(!this.confirmInfo.gridUuid){
        return this.$u.toast('请选择所属单元！')
      }
      const params = {
        gridId: gridUuid || this.confirmInfo.gridUuid
      }
      rspService.getNewResidentialByGridId(params).then(r=>{
        if (r.success) {
          let list = r.data || []
          list = list.map(v=>{
            v.label = v.residentialName
            v._value = v.residentialAreaUuid
            v.value = v.residentialAreaUuid
            return v
          })
          this.newCommunityList = list
          // 说明已经选过新小区情形了
          if(newData?.newCommunityUuid) {
            let _thisList = []
            _thisList = list.filter(v=>{
              return v.value == newData.newCommunityUuid
            })
            this.confirmInfo.newCommunityName = _thisList.length ? _thisList[0].label : ''
          }
        } else {
          this.newCommunityList = []
        }
      },e=>{
        this.newCommunityList = []
      })
    },
    // 当选择社区后，调用接口提示信息
    checkMarginSufficient(){
      // console.log(this.confirmInfo);
      let codeArr = this.confirmInfo.businessAddrAdc.split(',');
      let [orgUuid,areaCode,streetCode,communityCode,] = [this.user.user.org.orgUuid,codeArr[2],this.confirmInfo.townCode,this.confirmInfo.villageCode,];
      // let [orgUuid,areaCode,streetCode,communityCode,] = ['000000000001389361297605_6060_85','330302','33030200600010000','33030200604512111',];     
      certificateService.checkMarginSufficient(orgUuid,areaCode,streetCode,communityCode).then((res) => {
        if(res.success){
          if(res.bean.msgFlag){
            this.$modal.alert(res.bean.msgText);  
          } 
        }
      }).catch((err) => {
        console.log(err);
      });
    },
    validatorFiled(type) {
      if (type == 'townCode') this.$refs.townChangeRef.validation();
      if (type == 'villageCode') this.$refs.villageChangeRef.validation();
      if (type == 'areaType') this.$refs.areaRef.validation();
      if (type == 'addr') this.$refs.busAddrRefs.validation();
    },
    clicDatekHandle(type) {
      if (this.isDisable) return;
      if(type == 'isShowCyBeginStart' || type == 'isShowCyBeginEnd'){
        if(this.confirmInfo.isLongTenancy == 'true' || this.confirmInfo.isLongTenancy == true){
          return;
        }
        if(type == 'isShowCyBeginEnd' && !this.$u.test.isEmpty(this.confirmInfo.tenancyBeginDate)){
          try{
            let mDate = new Date(this.confirmInfo.tenancyBeginDate.replace('年', '-').replace('月', '-').replace('日', ''));
            this.showCyEndMin = this.$u.date( mDate.getTime() + (1000 * 60 * 60 * 24 * 30), 'yyyy-mm-dd');
          }catch(e){
            console.log(e);
          }
        }
      }
      this[type] = true;
    },
    changeDate(type, e) {
      this.confirmInfo[type] = this.$u.date((new Date(e.result)).getTime(), "yyyy-mm-dd");
      if(type == 'tenancyBeginDate'){
        this.confirmInfo.tenancyEndDate = "";
        this.confirmInfo.tenancyDate = "";
      }else if(type == 'tenancyEndDate'){
        if(this.$u.test.isEmpty(this.confirmInfo.tenancyBeginDate)){
          this.confirmInfo.tenancyDate = "";
        }else{
          this.confirmInfo.tenancyDate = this.confirmInfo.tenancyBeginDate + " 至 " + this.confirmInfo.tenancyEndDate;
        }
      }
    },
    saveSign(v) {
      console.log(v);
      this.isShowSignView = false;
      this.$modal.showLoading('保存签名...');
      let uploadParam = {
        // 'fiGroupCode': 'zmglpt-regie-cq-images',
      };
      uploadParam.fileName = Date.now() + '.jpg';
      commonService.uploadBase64ForApp(v, uploadParam).then(res => {
        this.$modal.hideLoading();
        if (res.success) {
          this.signImgList = [res.bean,]
          this.confirmInfo.signNameFileId = res.bean.gfiId;
        } else {
          console.log(res.msg);
          this.$u.toast('签名信息保存失败');
        }
      }).catch(er => {
        console.log(er);
        this.$modal.hideLoading();
        this.$u.toast('签名信息保存失败');
      });
    },
    // 上传/删除图片事件
    changeUpload(list, key) {
      if (key == 'signImgList') {
        if (list.length == 0) {
          this.confirmInfo.signNameFileId = "";
        }
        return;
      }
      // 柜台、门头、车辆照片
      if (list.length > 0) {
        this[key] = list;
      } else {
        this[key] = [];
      }
      if(key == 'managerPhoto'){
        this.confirmInfo.managerPhotoPath = list.length == 0 ? "" : list[0].gfiId;
      }
    },
    showSignView() {
      this.isShowSignView = true;
    },
    // switch开关
    switchChange(status, type, desc) {
      // 是否长期
      if(type == 'isLongTenancy'){
        if(status){
          this.confirmInfo.tenancyEndDate = "";
          this.confirmInfo.tenancyBeginDate = "";
          this.confirmInfo.tenancyDate = "";
        }
        return;
      }
      // 是否涉及重大行政许可
      if (type === 'isImportLic') {
        console.log(status, type, desc);
        if (!status) {
          this.confirmInfo.isImportLicContent = '';
          this.confirmInfo.isImportLicName = '';
        }
        this.isImportLic = status;
        this.$set(this.confirmInfo, 'isImportLic', status ? true : false);
      }else {
        this.confirmInfo[type] = status;
      }
      if (!status) {
        this.confirmInfo[desc] = "";
      }
    },
    // 经营场所地址坐标
    setLocation() {
      if (this.isDisable) return;
      if (!this.confirmInfo.businessAddrAdc) {
        uni.showToast({
          title: "请先选择经营地址",
          icon: "none"
        });
        return;
      }
      const { longitude, latitude } = this.confirmInfo;
      this.$u.route({
        url: "pages/certificate/fieldAudit/orientationDiagram/mapCoordinate",
        params: {
          lng: longitude || "",
          lat: latitude || "",
          gridUuid: this.confirmInfo.gridUuid || ""
        }
      });
      const codeArr = this.confirmInfo.businessAddrAdc.split(",") || '';
      this.$storage.set("curConfirmInfo", {
        curBizUuid: this.docIns.bizUuid,
        curAreaCode: codeArr[2],
        fieldAuditUuid: this.confirmInfo.fieldAuditUuid,
        handleMainUuid: this.confirmInfo.handleMainUuid
      });
    },
    // 查看周围零售户
    lookLocation() {
      if (!this.isDisable) {
        if(this.confirmInfo.longitude && this.confirmInfo.latitude){
          this.setRouteParam({
            longitude: this.confirmInfo.longitude,
            latitude: this.confirmInfo.latitude,
          });
        }
        this.$u.route('pages/retailer/field/field');
      }
    },
    // 合理布局
    selLayoutDict() {
      if (this.isDisable) return
      if (this.docIns.step === 'view') return;
      this.layoutShow = true;
    },
    // 选择合理布局
    handlerSelectlayout(pItems) {
      this.layoutShow = false;
      let [licenseBasis, licenseBasisStr, self,] = [
        [],
        [], this,
      ];
      pItems.forEach((_item) => {
        licenseBasis.push(_item.bcbCode);
        licenseBasisStr.push(_item.bcbName);
      });
      self.$set(self.confirmInfo, 'licenseBasis', licenseBasis.join(","));
      self.$set(self.confirmInfo, 'licenseBasisStr', licenseBasisStr.join(","));
      this.defaultUids = licenseBasis;
    },
    // 表单校验
    validForm(type) {
      let confirmValid = false;
      this.btnType = type;
      this.$refs.uForm.validate(valid => {
        console.log(valid, 'dddddddddddddddddd')
        if (valid) {
          confirmValid = true;
        } else {
          confirmValid = false;
        }
      });
      return confirmValid;
    },
    // 群体类型互斥逻辑函数
    logicFun(item, selectedItems) {
      if (selectedItems.length > 0 && selectedItems[0].value == '01') {
        selectedItems = [];
        selectedItems.push(item);
        return selectedItems;
      } else {
        if (item.value == '01') {
          selectedItems = [];
          selectedItems.push(item);
          return selectedItems;
        } else {
          selectedItems.push(item);
          return selectedItems;
        }
      }

    },
    // 群体类型多选
    dicMultiSelectOpen(type, keyWords) {
      if (type == this.dicType) {
        if (this.dicKeyWords == keyWords && this.mulitChoiceShow) {
          return true;
        }
        return false;
      }
    },
    showMultiDic(key, cur, type) {
      if (this.isDisable) return
      if (this.mulitChoiceShow) return;
      this.dicKeyWords = key;
      this.dicCurrentSelect = cur;
      this.mulitChoiceShow = true;
      this.dicType = type;
    },
    // 群体类型所选确认按钮
    multiChoiceConfirm(e) {
      this.mulitChoiceShow = false;
      let labels = [];
      let codes = [];
      e.forEach(itm => {
        labels.push(itm.bcbName);
        codes.push(itm.bcbCode);
      });
      this.confirmInfo.specialGroupName = labels.join(',');
      this.confirmInfo.specialGroupType = codes.join(',');
      if (this.confirmInfo.specialGroupType.indexOf('08') != -1) {
        this.confirmInfo.isSpecialGroupTypeOther = true;
      } else {
        this.confirmInfo.isSpecialGroupTypeOther = false;
      }
    },
    //
    setNearState(isNearSchool, nearSchoolDesc, isNearGarten, nearGartenDesc){
      this.$set(this.confirmInfo, 'isNearSchool', isNearSchool);
      this.confirmInfo.nearSchoolInstruction = nearSchoolDesc;
      this.$set(this.confirmInfo, 'isNearGarten', isNearGarten);
      this.confirmInfo.nearGartenInstruction = nearGartenDesc;
    },
    uploadCutFile(src) {
      this.$modal.showLoading('保存截图...');
			// 当前位置信息截图生成经营场所方位图 --上传图片  fsx 2024-2-23 开始
      let uploadParam = {bizId:this.docIns.bizUuid,fiGroupCode:'l_audit_addr_img',fiLogicPath:'l_audit_addr_img',};
			// 当前位置信息截图生成经营场所方位图 --上传图片  fsx 2024-2-23 结束
      uploadParam.fileName = Date.now() + '.jpg';
      commonService.uploadBase64ForApp(src, uploadParam).then(res => {
        this.$modal.hideLoading();
        if (res.success) {
          this.addrImgs.push(res.bean);
        } else {
          console.log(res.msg);
        }
      }).catch(er => {
        console.log(er);
        this.$modal.hideLoading();
      });
    },
	// 上传在线画图 经营场所图 fsx 2024-6-3 开始
	uploadAuditPlaceImg(src) {
	  this.$modal.showLoading('保存中...');
	  let uploadParam = {bizId:this.docIns.bizUuid,fiGroupCode:'l_audit_place_img',fiLogicPath:'l_audit_place_img',};
	  uploadParam.fileName = Date.now() + '.jpg';
	  commonService.uploadBase64ForApp(src, uploadParam).then(res => {
	    this.$modal.hideLoading();
	    if (res.success) {
	      this.placeImgs.push(res.bean);
	    } else {
	      console.log(res.msg);
	    }
	  }).catch(er => {
	    console.log(er);
	    this.$modal.hideLoading();
	  });
	},
	// 上传在线画图 经营场所图 fsx 2024-6-3 结束
	
    // 获取所属街道（乡镇）列表
    getTownInfoList(txt) {
      return new Promise((resolve, reject) => {
        if (this.$u.test.isEmpty(txt)) {
          resolve([]);
          return;
        }
        let list = this.streetData.filter((item) => {
          return item.label.indexOf(txt) != -1;
        });
        if(list.length > 0){
          list.forEach(itm => {
            itm.name = [itm.label,].join("");
          });
          resolve(list);     
        }else{
          resolve([]); 
          this.confirmInfo.town = "";
        }
        
      });
    },
    // 获取社区（行政村）列表
    getVillageInfoList(txt) {
      return new Promise((resolve, reject) => {
        if (this.$u.test.isEmpty(txt)) {
          resolve([]);
          return;
        }
        let list = this.villagesData.filter((item) => {
          return item.label.indexOf(txt) != -1;
        });
        if(list.length > 0){
          list.forEach(itm => {
            itm.name = [itm.label,].join("");
          });
          resolve(list);     
        }else{
          resolve([]); 
          this.confirmInfo.village = "";
        }
        
      });
    },
    // 获取自定选择的数据（所属街道 或 所属区县）
    choiceAutoItem(itm, index){
      if(index == '1'){
        this.confirmInfo.townCode = itm.value;
        this.confirmInfo.town = itm.name;
        this.$emit('ok', this.confirmInfo.townCode);
        this.$emit('showVal', this.confirmInfo.townCode, this.streetData, true);
      }else{
        this.confirmInfo.villageCode = itm.value;
        this.confirmInfo.village = itm.name;
        this.$emit('showVal', this.confirmInfo.villageCode, this.villagesData, false); 
        // 新增提示内容 是队员 && 是新办 && 非电子烟任务 当选择社区后，调用接口提示信息
        if(!this.isDisable && this.fieldData.applyType == '01' && !this.isElectronicCigarette){
          this.checkMarginSufficient();
        }    
      }
    },
    radioChange(e,type,desc){
      this.confirmInfo[type] = e;
      if (e != '1') {
        this.confirmInfo[desc] = "";
      }
    },
    bindBizFDetailPickerChange: function(e) {
      let index = e.detail.value
      this.bizfDetailIndex = index
      this.confirmInfo.bizFormatDetailName = this.bizFormatDetailList[index].text
      this.confirmInfo.bizFormatDetail = this.bizFormatDetailList[index].value
      this.$forceUpdate()
    },
	// 在线画图集成
	selectDraw(){
		this.$u.route({
			url: '/pages/commonPage/thirdPartyDraw',
		});
	},
  nearbyRetailersDistanceChange(){
    console.log(this.confirmInfo.nearbyRetailersDistance , this.distance);
    if(this.distance && (Number(this.confirmInfo.nearbyRetailersDistance) > Number(this.distance))){
      this.$u.toast('附近零售户距离不能大于放宽政策规定的距离！')
    }
  }
  },
};
</script>

<style lang="scss" scoped>
	@import "style/certificate/common.scss";
  .page{
    padding: 0;
  }
	.row {
		width: calc(100% + 20px);
		height: 16rpx;
		background-color: $u-type-info-light;
		margin-left: -10px;
	}

	/deep/.u-form-item--left__content--required {
		position: initial;
	}

	.addr-info /deep/.u-form-item--right__content__slot {
		display: inline;
	}

	// .addr-info /deep/.u-icon--right {
	// 	margin-top: 44px;
	// }

	/deep/.u-select__header {
		font-size: 16px;
	}

	/deep/.multi-page .title {
		color: black;
		text-align: center;
	}
	.addr-new-info /deep/.u-form-item--right__content__slot {
	display: inline;
	margin-bottom: -12px
	}

.tmp-head{
	width: 100%;
	display: inline-flex;
	flex-direction: row;
	justify-content: flex-start;
	align-items: center;
	margin-top: 25rpx;
	margin-bottom: 15rpx;
	margin-left: -16rpx;
}
.apple-special-title{
  display: flex;
  justify-content: flex-start;
  align-items: center;
}
.apple-special-con{
  margin: 0 16rpx 0 0;
  padding: 10rpx;
}
/deep/.abslay{
  bottom: 50px !important;
}
.grid-list-laz{
  position:absolute;
  z-index:1990;
  top:90px;
  width:100%;
  background:#fff;
  border: 1px solid #ddd;
  .each-grid{
    overflow:hidden;
    padding: 5px 20px;
    line-height: 27px;
    border-top:1px solid #ddd;
    text{
      padding-left:32rpx;
      color:red;
    }
  }
  .each-grid:first-child{
    border-top:0;
  }

}

.m-list-item {
	width: 200rpx;
	height: 200rpx;
	overflow: hidden;
	margin: 10rpx;
	background: rgb(244, 245, 246);
	position: relative;
	border-radius: 10rpx;
	/* #ifndef APP-NVUE */
	display: flex;
	/* #endif */
	align-items: center;
	justify-content: center;
}

.m-preview-wrap {
	border: 1px solid rgb(235, 236, 238);
}

.m-add-wrap {
	flex-direction: column;
	color: $u-content-color;
	font-size: 26rpx;
}

.m-add-tips {
	margin-top: 20rpx;
	line-height: 40rpx;
}

.m-add-wrap__hover {
	background-color: rgb(235, 236, 238);
}
	
</style>
